<?php
class Application_Model_Filter_TaskSearch{
    /**
     * 任务内容
     */
    public $name;
    /**
     * 类型
     */
    public $type;
    /**
     * 状态
     */
    public $status;
    
    function getSearchFileds() {
        $where = array();
        $and = "";
        if($this->name != ""){
            $where[$and."( name like "] = "%$this->name%";
            $and = " or ";
            $where[$and." code like "] = "%$this->name%";
            $where[" ) and 1 = "] = 1;
            $and = " and ";
        }
        if($this->type != ""){
            $where[$and." type = "] = $this->type;
            $and = " and ";
        }
        if($this->status != ""){
            $where[$and." status = "] = $this->status;
            $and = " and ";
        }
        return $where;
    }
}
